import lejos.nxt.*;
import lejos.robotics.navigation.Pilot;
import lejos.robotics.navigation.TachoPilot;

/**
 * Trace a square 
 * @author Roger
 */
public class square
{
    Pilot pilot ;
    public void  drawSquare(float length, int veelhoek)
    {
    	int graden = (veelhoek-2)*180;
        for(int i = 0; i<veelhoek; i++)
        {
            pilot.travel(length);
            pilot.rotate(180-graden/veelhoek); 
            pilot.arc(15f);
        }
    }
    public void  turn()
    {
            pilot.rotate(180);
        
    }
    public static void main(String[] args)
    {
        square sq = new square();
        sq.pilot = new TachoPilot(2.2f, 4.43f, Motor.A, Motor.C, true);

        sq.drawSquare(20, 4);
        //sq.turn();
    }
}


